package com.chapter_8;

/**
 * @Author: Timo
 * @Date: 2019/5/16 16:31
 * @Description: 类用途：
 */
public class WorkerThread extends Thread{

    private final Channel channel;

    public WorkerThread(String name, Channel channel) {
        super(name);
        this.channel = channel;
    }



    @Override
    public void run() {
        while (true) {
            Request request = channel.takeRequest();
            request.execute();
        }
    }
}
